from api.kdtx_api import KDTXApi


class TokenUtil:

    # 封装一个读取token的方法
    @classmethod
    def get_token(cls):
        resp_code = KDTXApi.get_code_api()
        uuid = resp_code.json().get("uuid")
        login_body = {
            "username": "admin",
            "password": "HM_2023_test",
            "code": "2",
            "uuid": uuid
        }
        resp_login=KDTXApi.login_api(login_body)
        token =resp_login.json().get("token")
        return token

        pass

    pass
